"""pingresq报文封装"""
from umq.mqtt.packet import MqttFixedHeader, MqttPacket, PINGRESP 
from umq.errors import UMQException


class PingrespPacket(MqttPacket):
    """disconnect 封装"""
    def __init__(self, fixed: MqttFixedHeader = None):
        if fixed is None:
            header = MqttFixedHeader(PINGRESP, 0x00)
        else:
            if fixed.packet_type is not PINGRESP:
                raise UMQException('Invalid packe type: {}'.format(fixed.packet_type))
            header = fixed
        super().__init__(header)
        self.variable = None
        self.payload = None
